from setuptools import setup

# Available at setup time due to pyproject.toml
from pybind11.setup_helpers import Pybind11Extension, build_ext, ParallelCompile

__version__ = "0.0.1"

# The main interface is through Pybind11Extension.
# * You can add cxx_std=11/14/17, and then build_ext can be removed.
# * You can set include_pybind11=false to add the include directory yourself,
#   say from a submodule.
#
# Note:
#   Sort input source files if you glob sources to ensure bit-for-bit
#   reproducible builds (https://github.com/pybind/python_example/pull/53)

ext_modules = [
    Pybind11Extension("manano._manano",
                      ["src/manano.cpp",
                       "src/indi_filter.cpp",

                       "src/indi_ma_macd.cpp",
                       "src/indi_ma_osc.cpp",
                       "src/indi_ma_rsi.cpp",
                       "src/indi_ma.cpp",

                       "src/indi_misc.cpp",

                       "src/indi_ordered.cpp",

                       "src/indi_s2_band.cpp",
                       "src/indi_s2_cov.cpp",
                       "src/indi_s2_var.cpp",
                       "src/indi_s2_zscore.cpp",

                       "src/indi_s4_kurtosis.cpp",
                       "src/indi_s4_skewness.cpp",
                       "src/indi_s4.cpp",

                       "src/indi_scale.cpp"
                       ],
                      # Example: passing in the version to the compiled code
                      define_macros=[('VERSION_INFO', __version__)],
                      include_dirs = ["extern"],
                      ),
]

ParallelCompile("NPY_NUM_BUILD_JOBS").install()

setup(
    name="manano",
    version=__version__,
    author="Jun",
    author_email="imlijunda@gmail.com",
    url="https://gitee.com/june-duck/manano",
    description="Python binding to mdtx-online",
    long_description="Pythond binding to mdtx-online, a collection of online algorithms and indicators.",
    ext_modules=ext_modules,
    extras_require={"test": "pytest"},
    packages=['manano'],
    # Currently, build_ext only provides an optional "highest supported C++
    # level" feature, but in the future it may provide more features.
    cmdclass={"build_ext": build_ext},
    zip_safe=False,
)
